package com.weixiaodong.ModelDesign.交给子类.TemplateMethod模式.模版方法实例;

public class CharDisplace extends AbstractDisplace {

    private char ch;

    public CharDisplace(char ch) {
        this.ch = ch;
    }

    @Override
    public void open() {
        System.out.println("打开钢笔");
    }

    @Override
    public void print() {
        System.out.println(ch);
    }

    @Override
    public void close() {
        System.out.println("关闭钢笔");
    }


    public static void main(String[] args) {
        CharDisplace charDisplace = new CharDisplace('a');
        charDisplace.displace();
    }
}
